<template>
    <div>
        <img class="imagBack" src="@/assets/cat.jpg" alt="Background Image">
    </div>
</template>

<script>
import { GetUserDetail } from '@/api/user';

export default {
    methods: {
        async getUserInfo() {
            let res = await GetUserDetail()
            console.log(res.data)
            if (res.code == 1) {
                this.$store.commit('setUserInfo', res.data)
            }
        }
    },
    mounted() {
          this.getUserInfo()
    }
}
</script>

<style lang="less" scoped>
/* 使图片充满容器 */
.imagBack {
    width: 100%;
    /* 图片宽度充满容器宽度 */
    height: 450px;
    /* 图片高度充满容器高度 */
    object-fit: cover;
    /* 确保图片按照容器尺寸缩放，并保持其比例，裁剪超出部分 */
    display: block;
    /* 去除默认的内边距 */
}
</style>